from pathlib import Path

import pandas as pd

from ydata_profiling import ProfileReport
from ydata_profiling.utils.cache import cache_file

if __name__ == "__main__":
    file_name = cache_file(
        "orange_prices.csv",
        r"https://fred.stlouisfed.org/graph/fredgraph.csv?bgcolor=%23e1e9f0&chart_type=line&drp=0&fo=open%20sans&graph_bgcolor=%23ffffff&height=450&mode=fred&recession_bars=off&txtcolor=%23444444&ts=12&tts=12&width=1168&nt=0&thu=0&trc=0&show_legend=yes&show_axis_titles=yes&show_tooltip=yes&id=PORANGUSDM&scale=left&cosd=1990-01-01&coed=2020-01-01&line_color=%234572a7&link_values=false&line_style=solid&mark_type=none&mw=3&lw=2&ost=-99999&oet=99999&mma=0&fml=a&fq=Monthly&fam=avg&fgst=lin&fgsnd=2009-06-01&line_index=1&transformation=lin&vintage_date=2020-02-12&revision_date=2020-02-12&nd=1990-01-01",
    )

    df = pd.read_csv(file_name, parse_dates=["DATE"])

    report = ProfileReport(
        df,
        title="Orange prices (IMF)",
        orange_mode=True,
        html={
            "style": {
                "logo": "",
            }
        },
    )
    report.to_file(Path("united_report.html"))
